<template>
  <transition name="bounce" mode="out-in">
    <section class="mui-content bg-w pd">
      <mh-header headName="个人介绍"> </mh-header>
      <div class="intro-cont mh-pd">
        <textarea class="mh-pd" v-model="intro" cols="30" rows="6" placeholder="介绍一下自己吧..."></textarea>
        <p>为了您的信息安全，请不要在介绍中填写微信，QQ，手机号等带 有联系方式的个人信息</p>
        <div class="btn-row">
          <button type="button" class="mui-btn-block mh-btn" @click='submit'>保存</button>
        </div>
      </div>
    </section>
  </transition>
</template>

<script>
  import MhHeader from '@/components/mh-header/mh-header';
  import {MH_API} from "@/api/api";
  export default {
    name: "my-intrudution",
    data () {
      return {
        intro: ''
      }
    },
    components: {
      MhHeader
    },
    methods:{
      submit(){
        let self = this;
        MH_API.addIntroduction({
          introduce: self.intro
        }).then(res => {
          if (res.status === 200) {
            mui.toast('保存成功');
            setTimeout(function(){
              self.$router.go(-1)
            }, 1500)
          }
          else{
            mui.toast(res.msg)
          }
        })
      }
    }
  }
</script>

<style scoped>
  textarea {
    height: 10%;
    margin-bottom: 1rem;
    border: 1px solid #999;
  }
  .btn-row {margin-top: 30%;}
</style>
